package com.qf.util;

import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.pool.DruidDataSourceFactory;


import javax.sql.DataSource;
import java.io.InputStream;
import java.util.Properties;


/*
 *@Description:
 *@author:刘哥
 *@Date:14:19 2022/7/9
 */
//public class DataSourceUtils {
//    private static DruidDataSource dataSource;
//    static {
//        try {
//            Properties properties=new Properties();
//            InputStream is=DataSourceUtils.class.getClassLoader().getResourceAsStream("druid.properties");
//            properties.load(is);
//            is.close();
//            dataSource = (DruidDataSource) DruidDataSourceFactory.createDataSource(properties);
//        } catch (Exception e) {
//            throw new RuntimeException("初始化数据失败"+e.getMessage());
//        }
//    }
//    public static DataSource getDateSource(){return dataSource;}
//
//}
